#include "RenzoMustHave.h"
#include "RenzoPrecompiled.h"
#include "RenzoMesh.h"
#include "RenzoCamera.h"
#include "RenzoScene.h"
#include "RenzoSceneNode.h"
#include "RenzoSceneManager.h"
#include "RenzoRenderSystem.h"
#include "RenzoRenderBuffer.h"

namespace Renzo
{
	void rzTestSceneGraph_Kickoff(int argc, char* argv[])
	{
		Renzoderer* rz = Renzoderer::instance();
		rz->setArguments(argc, argv);
		rz->setWindowSize(800, 600);
	#ifdef _DEBUG
		rz->loadPlugin("RenzodererGL_d.dll");
		rz->loadPlugin("RenzoFreeImage_d.dll");
		rz->loadPlugin("RenzoSceneIO_d.dll");
	#else
		rz->loadPlugin("RenzodererGL.dll");
		rz->loadPlugin("RenzoFreeImage.dll");
		rz->loadPlugin("RenzoSceneIO.dll");
	#endif
		
		
		// load a scene
		SceneManager* sm = Renzoderer::instance()->getSceneManager();
		SceneNode* root = sm->load("./data/scene/leafy tree 2.dae");
		Scene* s = new Scene;
		s->attach(root);

		s->setActiveCameraAuto();

		rz->addScene(s);
		rz->setActiveScene(s);
		
		// attach scene to viewport
		// attach viewport to window
		// show
		rz->kickoff();
		rz->unloadPlugin("RenzodererGL.dll");

		rzDel(s);
	}
}